package org.feng.entity;

import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.CreationTimestamp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.quarkus.hibernate.orm.panache.PanacheEntityBase;

@Entity
@Table(name = "KEY_USER")
public class KeyUser extends PanacheEntityBase {
	
	public KeyUser() {
		//getEntityObject();
	}

	@Id
	@GeneratedValue
	@Column(name = "序号")
	@NotBlank(message="Title may not be blank")
	@Min(message="Author has been very lazy", value=1)
	private Long id;

	@Column(name = "姓名")
	@NotNull(message = "名称不能为空")
	//@JsonProperty("user_name")
	private String name;

	@Column(name = "支付")
	@NotNull(message = "年龄不能为空")
	@JsonIgnore
	private Integer age;

	@CreationTimestamp
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@Column(name = "TIME_UPDATE")
	@NotNull(message = "生日不能为空")
	@JsonProperty("生日")
	private LocalDateTime birthday;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public LocalDateTime getBirthday() {
		return birthday;
	}

	public void setBirthday(LocalDateTime birthday) {
		this.birthday = birthday;
	}

}
